<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Remote Control: CDSlotOpen.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Remote Control
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_c_d_slot_open_8cpp_source.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">CDSlotOpen.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &lt;exception&gt;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;Device.h&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;CDSlotOpen.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div>
<div class="line"><a name="l00005"></a><span class="lineno"><a class="code" href="class_c_d_slot_open.html#a1a55f2182cb156855870712fdd3f4e0a">    5</a></span>&#160;<a class="code" href="class_c_d_slot_open.html#a1a55f2182cb156855870712fdd3f4e0a" title="CTor of the CDSlotOpen.">CDSlotOpen::CDSlotOpen</a>(<a class="code" href="class_stereo.html" title="Header for the Stereo class.">Stereo</a> * dev) {</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;   <span class="keywordflow">if</span> (dev == 0) { <span class="keywordflow">throw</span> std::exception(<span class="stringliteral">&quot;null pointer in CDSlotClose()...&quot;</span>); }</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;   mDevice = dev;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;   mLastState = dev-&gt;<a class="code" href="class_device.html#aa376b407fab23a440fd0123dd5512bc0" title="Get the on/off state of a device.">getOnOffState</a>();</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;   mLastCDState = dev-&gt;<a class="code" href="class_stereo.html#a811c7e727a9a1af9bc69f92bf102ec96" title="Function to return the state of the CD slot.">getCDState</a>();</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;}</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="code" href="class_c_d_slot_open.html#a6c265330a0718a8f7d3a9aee707c820a">   12</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_d_slot_open.html#a6c265330a0718a8f7d3a9aee707c820a" title="Executes the command.">CDSlotOpen::Execute</a>() {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;   mLastState = mDevice-&gt;<a class="code" href="class_device.html#aa376b407fab23a440fd0123dd5512bc0" title="Get the on/off state of a device.">getOnOffState</a>();</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;   mLastCDState = mDevice-&gt;<a class="code" href="class_stereo.html#a811c7e727a9a1af9bc69f92bf102ec96" title="Function to return the state of the CD slot.">getCDState</a>();</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;   mDevice-&gt;<a class="code" href="class_stereo.html#a883df02ac0b105a2ff31c98a642b6aa5" title="Function to open a CD slot.">Open</a>();</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;}</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="code" href="class_c_d_slot_open.html#a5369d9910a371d1e3b09cfe34e32a54f">   18</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_d_slot_open.html#a5369d9910a371d1e3b09cfe34e32a54f" title="Undos the last action.">CDSlotOpen::Undo</a>() {</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;   mDevice-&gt;<a class="code" href="class_device.html#ab9762d9490a6d2c1554cc7fdaff0c660" title="Set the on/off state of a device.">setOnOffState</a>(mLastState);</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;   mDevice-&gt;<a class="code" href="class_stereo.html#a9c0a4d05861d74a73b1c0fbdfd5af2fc" title="Function to set the state of the CD slot.">setCDState</a>(mLastCDState);</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>CDSlotOpen.cpp</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
